// 路由器对象模块
import Vue from "vue";
import VueRouter from "vue-router";
import MSite from "../pages/MSite/MSite.vue";//首页
import Order from "../pages/Order/Order.vue";//产品
import Profile from "../pages/Profile/Profile.vue";//个人中心
import Search from "../pages/Search/Search.vue";//搜索
import Login from "../pages/Login/Login.vue";//登录
import Oppo from "../pages/oppo/oppo.vue"//测试
import Shop from "../pages/Shop/Shop.vue";
import ShopGoods from "../pages/Shop/ShopGoods/ShopGoods.vue";
import ShopInfo from "../pages/Shop/ShopInfo/ShopInfo.vue";
import ShopRatings from "../pages/Shop/ShopRatings/ShopRatings.vue";
import Landing from '../pages/Login/Landing.vue'

//声明使用插件
Vue.use(VueRouter);
export default new VueRouter({
    //所有路由
    routes:[
        {
            path:'/msite',
            component:MSite,
            meta:{
                showfooter:true
            }
        },
        {
            path:'/search',
            component:Search,
            meta:{
                showfooter:true
            }
        },
        {
            path:'/order',
            component:Order,
            meta:{
                showfooter:true
            }
        },
        {
            path:'/profile',
            component:Profile,
            meta:{
                showfooter:true
            }
        },
        {
            path:'/',
            redirect:'/msite'
        },
        {
            path:'/login',
            component:Login,
        },
        {
          path:'/landing',
          component:Landing,
        },
        {
            path:'/oppo',
            component:Oppo
        },
        {
            path:'/shop',
            component:Shop,
                children:[
                    {
                        path:'/shop/goods',
                        component:ShopGoods
                    },
                    {
                        path:'/shop/info',
                        component:ShopInfo
                    },
                    {
                        path:'/shop/ratings',
                        component:ShopRatings
                    },
                    {
                        path:'',
                        redirect:'/shop/goods'
                    },
                ]
        },
    ]
})
